package pub.pjoc.util;

import com.google.common.primitives.Chars;

/**
 * @author xiongyingqi
 * @since 16-12-6 下午8:32
 */
public abstract class Words {
  public static char[] upperCaseLetters;
  public static char[] lowerCaseLetters;
  public static char[] numbers;

  static {
    lowerCaseLetters = new char[26];
    upperCaseLetters = new char[26];
    numbers = new char[10];
    char a = 'a';
    for (int i = 0; i < 26; i++) {
      lowerCaseLetters[i] = (char) (a + i);
    }

    char upperCaseA = 'A';
    for (int i = 0; i < 26; i++) {
      upperCaseLetters[i] = (char) (upperCaseA + i);
    }

    char number = '0';
    for (int i = 0; i < 10; i++) {
      numbers[i] = (char) (number + i);
    }
  }

  public static char[] upperCaseLetters() {
    return upperCaseLetters;
  }

  public static char[] lowerCaseLetters() {
    return lowerCaseLetters;
  }

  public static char[] letters() {
    return Chars.concat(lowerCaseLetters, upperCaseLetters);
  }

  public static char[] numbers() {
    return numbers;
  }

  public static char[] words() {
    return Chars.concat(lowerCaseLetters, upperCaseLetters, numbers);
  }
}
